classdef POSCAR < handle
  
  properties
    Name;
    LatticeConstant;
    LatticeVectors;
    AtomsPerAtomicSpecies;
    PositionCoordinates;   % Cartesian coordinates
    CoordinatesType;
    SelectiveDynamics;   % 1 or 0
    SelectiveDynamicsFlags; % should be T or F for each coordinate
    InitialVelocities;
    VelocityCoordinates;   
  end
  
  properties(Dependent)
    DirectCoordinates;
  end
    
  methods

    function pos = POSCAR(name,latticeConstant,latticeVectors,...
        atomsPerAtomicSpecies, coordinatesType, positionCoordinates,...
        varargin)
      pos.Name = name;
      pos.LatticeConstant = latticeConstant;
      pos.LatticeVectors = latticeVectors;
      pos.AtomsPerAtomicSpecies = atomsPerAtomicSpecies;
      pos.AtomsPerAtomicSpecies = atomsPerAtomicSpecies;
      pos.CoordinatesType = coordinatesType;
      pos.PositionCoordinates = positionCoordinates;
    end

    function directCoordinates = get.DirectCoordinates(po)
%       directCoordinates = zeros(size(po.PositionCoordinates, 1), ...
%         size(po.PositionCoordinates, 2));
      %co.Positions = basis.BasisVectors*lattice.LatticeVectors;
      directCoordinates = po.PositionCoordinates/(po.LatticeConstant*po.LatticeVectors);
%       
%       for i = size(directCoordinates, 1)
%         directCoordinates(i, :) = positionCoordinates 
%       end
%     
    end
    
%     function pos = POSCAR(name, latticeConstant, latticeVectors,...
%         atomsPerAtomicSpecies, selectiveDynamics, selectiveDynamicsFlags,...
%         positionCoordinates, initialVelocities, velocityCoordinates)
%       pos.Name = name;
%       pos.LatticeConstant = latticeConstant;
%       pos.LatticeVectors = latticeVectors;
%       pos.AtomsPerAtomicSpecies = atomsPerAtomicSpecies;
%       pos.SelectiveDynamics = selectiveDynamics;
%       pos.SelectiveDynamicsFlags = selectiveDynamicsFlags;
%       pos.PositionCoordinates = positionCoordinates;
%       pos.InitialVelocities = initialVelocities;
%       pos.VelocityCoordinates = velocityCoordinates;
%     end    

    
  end

  methods(Static)
      
    
    test();
  end

  
end

